import Request from '@/core/request/request'

// 这里注意，需要确认用户数已经完成的情况下才能进行 callback 的操作

async function funA () {
  var result = null
  await Request.post('/user').then(response => {
    result = response
  })
  // 这里的res就是axios请求回来的结果
  console.log('await', result)
  return result
}

console.log('funA', funA())

var syncuser = new Promise((resolve, reject) => {
  Request
    .post('/user')
    .then(response => {
      resolve(response)
    })
    .catch(err => {
      reject(err)
    })
})

export default syncuser
